(previous-error): Accept a prefix argument, similarly to next-error.
authorEli Zaretskii <eliz@gnu.org>
Mon, 1 Sep 2003 05:45:44 +0000 (05:45 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 1 Sep 2003 05:45:44 +0000 (05:45 +0000)
lisp/progmodes/compile.el

index 3effe71d30b9430d038337bf71fe91d6b17e3b94..f2bffa1a0896e04a66ec7e2566236f7fb8550d1f 100644 (file)
@@ -1751,11 +1751,15 @@ See variables `compilation-parse-errors-function' and
                           (consp argp))))
 ;;;###autoload (define-key ctl-x-map "`" 'next-error)
 
-(defun previous-error ()
+(defun previous-error (argp)
   "Visit previous compilation error message and corresponding source code.
-This operates on the output from the \\[compile] command."
-  (interactive)
-  (next-error -1))
+
+A prefix ARGP specifies how many error messages to move;
+negative means move forward to next error messages.
+
+This operates on the output from the \\[compile] and \\[grep] commands."
+  (interactive "P")
+  (next-error (- (prefix-numeric-value argp))))
 
 (defun first-error ()
   "Reparse the error message buffer and start at the first error.